filechooserwidget: Delay view switch to search hits
authorTimm Bäder <tbaeder@redhat.com>
Mon, 29 Apr 2019 06:33:02 +0000 (08:33 +0200)
committerTimm Bäder <mail@baedert.org>
Tue, 30 Apr 2019 03:36:20 +0000 (05:36 +0200)
Leave it to the ::hits-added handler to switch to the list of search
hits. This way we don't get a weird transition when the current search
didn't have any hits and the next one doesn't either.
Searches with hits still feel good.

gtk/gtkfilechooserwidget.c

index 350b11db67b1f57e6103fbefcb4cb206610852ac..aa3d9ef54a3185532486d77cbcdf1a5bc21e796b 100644 (file)
@@ -7150,8 +7150,6 @@ search_start_query (GtkFileChooserWidget *impl,
   set_busy_cursor (impl, TRUE);
   priv->show_progress_timeout = g_timeout_add (1500, show_spinner, impl);
 
-  gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_files_stack), "list");
-
   if (priv->search_engine == NULL)
     priv->search_engine = _gtk_search_engine_new ();
 
@@ -7185,6 +7183,10 @@ search_start_query (GtkFileChooserWidget *impl,
   if (gtk_query_get_location (priv->search_query) &&
       _gtk_file_consider_as_remote (gtk_query_get_location (priv->search_query)))
     gtk_widget_show (priv->remote_warning_bar);
+
+  /* We're not showing the file list here already and instead rely on the
+   * GtkSearchEntry timout and the ::hits-added signal from above to
+   * switch. */
 }
 
 /* Callback used when the user presses Enter while typing on the search